<template>
    <!-- 组件结构 -->
    <div class="school">
        <h2 @click="showName">学校名称：{{name }}</h2>
        <h2>学校地址：{{address}}</h2>
        <button @click="sendSchoolName">点击发送学校名称</button>
    </div>
</template>
<script>

    export default {
        name: 'School',
        data(){
            return{
                name:'Polaris',
                address:'青岛'
            }
        },
        props:['getSchoolName'],
        methods:{
            sendSchoolName(){
                this.getSchoolName(this.name)
            }
        }


    }
</script>
<style scope>
    .school{
        background-color: skyblue;
        padding: 5px;
    }
</style>
